package com.bafa.front.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bafa.exceptions.ErrorException;
import com.bafa.front.DaddyServlet;
import com.bafa.objects.season.Division;
import com.bafa.objects.team.Team;
import com.bafa.services.RetrieveServices;

public class DisplayAddFixtureServlet extends AdminServlet {

	@Override
	public void doAdminEvent(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, ErrorException {
		Division division = RetrieveServices.getDivision(request.getParameter("SeasonId"),request.getParameter("DivisionId"));
		
		Team[] teams = division.teamArray();
		
		request.setAttribute("TEAMS", teams);
		request.setAttribute("DIVISION",division);
		url = "displayaddfixture.jsp";
	}
}
